home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Atari Compendium
/
The Atari Compendium (Toad Computers) (1994).iso
/
files
/
umich
/
tex
/
texsrc.arc
/
TEX4.C
< prev
next >
Wrap
C/C++ Source or Header
|
1988-09-14
|
54KB
|
2,176 lines
overlay "tex4"
#define EXTERN extern
#include "texd.h"
startinput () { /* 30 */ r_startinput
scanfilename () ;
if ( curext == 206 )
curext = 644 ;
packfilename ( curname , curarea , curext ) ;
while ( true ) {
beginfilerea () ;
if ( aopenin ( inputfile [ curinput .indexfield ] , inputpathspec ) )
goto lab30 ;
endfilereadi () ;
promptfilena ( 640 , 644 ) ;
}
lab30: curinput .namefield = amakenamestr ( inputfile [ curinput .indexfield
] ) ;
if ( jobname == 0 )
{
jobname = curname ;
openlogfile () ;
}
if ( termoffset + ( strstart [ curinput .namefield + 1 ] - strstart [
curinput .namefield ] ) > maxprintline - 2 )
println () ;
else if ( ( termoffset > 0 ) || ( fileoffset > 0 ) )
printchar ( 32 ) ;
printchar ( 40 ) ;
print ( curinput .namefield ) ;
termflush ( output ) ;
curinput .statefield = 33 ;
{
if ( ! inputln ( inputfile [ curinput .indexfield ] , false ) )
;
firmupthelin () ;
if ( ( eqtb [ 5315 ] .cint < 0 ) || ( eqtb [ 5315 ] .cint > 127 ) )
decr ( curinput .limitfield ) ;
else buffer [ curinput .limitfield ] = eqtb [ 5315 ] .cint ;
first = curinput .limitfield + 1 ;
curinput .locfield = curinput .startfield ;
line = 1 ;
}
}
internalfont zreadfontinfo ( u , nom , aire , s )
halfword u ;
strnumber nom , aire ;
scaled s ;
{/* 30 11 45 */ register internalfont Result;
r_readfontinfo
integer k ;
boolean fileopened ;
halfword lf, lh, bc, ec, nw, nh, nd, ni, nl, nk, ne, np ;
internalfont f ;
internalfont g ;
eightbits a, b, c, d ;
fourquarters qw ;
scaled sw ;
scaled z ;
integer alpha ;
quarterword beta ;
g = 0 ;
fileopened = false ;
packfilename ( nom , aire , 664 ) ;
if ( ! bopenin ( tfmfile ) )
goto lab11 ;
fileopened = true ;
{
{
lf = tfmtemp ;
if ( lf > 127 )
goto lab11 ;
tfmtemp = getc ( tfmfile ) ;
lf = lf * 256 + tfmtemp ;
}
tfmtemp = getc ( tfmfile ) ;
{
lh = tfmtemp ;
if ( lh > 127 )
goto lab11 ;
tfmtemp = getc ( tfmfile ) ;
lh = lh * 256 + tfmtemp ;
}
tfmtemp = getc ( tfmfile ) ;
{
bc = tfmtemp ;
if ( bc > 127 )
goto lab11 ;
tfmtemp = getc ( tfmfile ) ;
bc = bc * 256 + tfmtemp ;
}
tfmtemp = getc ( tfmfile ) ;
{
ec = tfmtemp ;
if ( ec > 127 )
goto lab11 ;
tfmtemp = getc ( tfmfile ) ;
ec = ec * 256 + tfmtemp ;
}
if ( ( bc > ec + 1 ) || ( ec > 255 ) )
goto lab11 ;
tfmtemp = getc ( tfmfile ) ;
{
nw = tfmtemp ;
if ( nw > 127 )
goto lab11 ;
tfmtemp = getc ( tfmfile ) ;
nw = nw * 256 + tfmtemp ;
}
tfmtemp = getc ( tfmfile ) ;
{
nh = tfmtemp ;
if ( nh > 127 )
goto lab11 ;
tfmtemp = getc ( tfmfile ) ;
nh = nh * 256 + tfmtemp ;
}
tfmtemp = getc ( tfmfile ) ;
{
nd = tfmtemp ;
if ( nd > 127 )
goto lab11 ;
tfmtemp = getc ( tfmfile ) ;
nd = nd * 256 + tfmtemp ;
}
tfmtemp = getc ( tfmfile ) ;
{
ni = tfmtemp ;
if ( ni > 127 )
goto lab11 ;
tfmtemp = getc ( tfmfile ) ;
ni = ni * 256 + tfmtemp ;
}
tfmtemp = getc ( tfmfile ) ;
{
nl = tfmtemp ;
if ( nl > 127 )
goto lab11 ;
tfmtemp = getc ( tfmfile ) ;
nl = nl * 256 + tfmtemp ;
}
tfmtemp = getc ( tfmfile ) ;
{
nk = tfmtemp ;
if ( nk > 127 )
goto lab11 ;
tfmtemp = getc ( tfmfile ) ;
nk = nk * 256 + tfmtemp ;
}
tfmtemp = getc ( tfmfile ) ;
{
ne = tfmtemp ;
if ( ne > 127 )
goto lab11 ;
tfmtemp = getc ( tfmfile ) ;
ne = ne * 256 + tfmtemp ;
}
tfmtemp = getc ( tfmfile ) ;
{
np = tfmtemp ;
if ( np > 127 )
goto lab11 ;
tfmtemp = getc ( tfmfile ) ;
np = np * 256 + tfmtemp ;
}
if ( lf != 6 + lh + ( ec - bc + 1 ) + nw + nh + nd + ni + nl + nk + ne +
np )
goto lab11 ;
}
lf = lf - 6 - lh ;
if ( np < 7 )
lf = lf + 7 - np ;
if ( ( fontptr == fontmax ) || ( fmemptr + lf > fontmemsize ) )
{
{
if ( interaction == 3 )
wakeuptermin () ;
printnl ( 133 ) ;
print ( 655 ) ;
}
sprintcs ( u ) ;
printchar ( 61 ) ;
printfilenam ( nom , aire , 206 ) ;
if ( s >= 0 )
{
print ( 598 ) ;
printscaled ( s ) ;
print ( 262 ) ;
}
else if ( s != - 1000 )
{
print ( 656 ) ;
printint ( - s ) ;
}
print ( 665 ) ;
{
helpptr = 4 ;
helpline [ 3 ] = 666 ;
helpline [ 2 ] = 667 ;
helpline [ 1 ] = 668 ;
helpline [ 0 ] = 669 ;
}
error () ;
goto lab30 ;
}
f = fontptr + 1 ;
charbase [ f ] = fmemptr - bc ;
widthbase [ f ] = charbase [ f ] + ec + 1 ;
heightbase [ f ] = widthbase [ f ] + nw ;
depthbase [ f ] = heightbase [ f ] + nh ;
italicbase [ f ] = depthbase [ f ] + nd ;
ligkernbase [ f ] = italicbase [ f ] + ni ;
kernbase [ f ] = ligkernbase [ f ] + nl ;
extenbase [ f ] = kernbase [ f ] + nk ;
parambase [ f ] = extenbase [ f ] + ne ;
{
if ( lh < 2 )
goto lab11 ;
{
tfmtemp = getc ( tfmfile ) ;
a = tfmtemp ;
qw .b0 = a ;
tfmtemp = getc ( tfmfile ) ;
b = tfmtemp ;
qw .b1 = b ;
tfmtemp = getc ( tfmfile ) ;
c = tfmtemp ;
qw .b2 = c ;
tfmtemp = getc ( tfmfile ) ;
d = tfmtemp ;
qw .b3 = d ;
fontcheck [ f ] = qw ;
}
tfmtemp = getc ( tfmfile ) ;
{
z = tfmtemp ;
if ( z > 127 )
goto lab11 ;
tfmtemp = getc ( tfmfile ) ;
z = z * 256 + tfmtemp ;
}
tfmtemp = getc ( tfmfile ) ;
z = z * 256 + tfmtemp ;
tfmtemp = getc ( tfmfile ) ;
z = ( z * 16 ) + ( tfmtemp / 16 ) ;
if ( z < 65536 )
goto lab11 ;
while ( lh > 2 ) {
tfmtemp = getc ( tfmfile ) ;
tfmtemp = getc ( tfmfile ) ;
tfmtemp = getc ( tfmfile ) ;
tfmtemp = getc ( tfmfile ) ;
decr ( lh ) ;
}
fontdsize [ f ] = z ;
if ( s != - 1000 )
if ( s >= 0 )
z = s ;
else z = xnoverd ( z , - s , 1000 ) ;
fontsize [ f ] = z ;
}
for ( k = fmemptr ; k <= widthbase [ f ] - 1 ; k ++ )
{
{
tfmtemp = getc ( tfmfile ) ;
a = tfmtemp ;
qw .b0 = a ;
tfmtemp = getc ( tfmfile ) ;
b = tfmtemp ;
qw .b1 = b ;
tfmtemp = getc ( tfmfile ) ;
c = tfmtemp ;
qw .b2 = c ;
tfmtemp = getc ( tfmfile ) ;
d = tfmtemp ;
qw .b3 = d ;
fontinfo [ k ] .qqqq = qw ;
}
if ( ( a >= nw ) || ( b / 16 >= nh ) || ( b % 16 >= nd ) || ( c / 4 >= ni
) )
goto lab11 ;
switch ( c % 4 )
{case 1 :
if ( d >= nl )
goto lab11 ;
break ;
case 3 :
if ( d >= ne )
goto lab11 ;
break ;
case 2 :
{
{
if ( ( d < bc ) || ( d > ec ) )
goto lab11 ;
}
while ( d < k + bc - fmemptr ) {
qw = fontinfo [ charbase [ f ] + d ] .qqqq ;
if ( ( ( qw .b2 ) % 4 ) != 2 )
goto lab45 ;
d = qw .b3 ;
}
if ( d == k + bc - fmemptr )
goto lab11 ;
lab45: ;
}
break ;
default :
;
break ;
}
}
{
{
alpha = 16 ;
while ( z >= 8388608 ) {
z = z / 2 ;
alpha = alpha + alpha ;
}
beta = 256 / alpha ;
alpha = alpha * z ;
}
for ( k = widthbase [ f ] ; k <= ligkernbase [ f ] - 1 ; k ++ )
{
tfmtemp = getc ( tfmfile ) ;
a = tfmtemp ;
tfmtemp = getc ( tfmfile ) ;
b = tfmtemp ;